package com.spring.jpaandmysql;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;

@Repository
public interface StudentRepository extends CrudRepository<Student,Long> {

    Student findByName(String name);

    Student findByNameAndAge(String name, Integer age);

    @Query("select u from Student u where u.name=:name")
    Student findStudent(String name);
}
